/*
 * @Description:
 * @version:
 * @Author: m
 * @LastEditors: m
 */
import { randomNum } from "@/utils/";

const tag = ["饺子", "面条", "抄手", "干锅", "冒菜"];
const name = ["万家饺子（软件园E18店）", "小锅饭豆腐馆（全运店）", "麦当劳麦乐送（全运路店）", "米村拌饭（浑南店）", "申记串道（中海康城店）"];

const business = {};

export default [
	{
		url: "/ele_page/business/list",
		type: "post",
		response: (res) => {
			let data = {
				limit: res.query.limit,
				page: res.query.page,
				rows: [],
			};

			for (let i = 0; i < parseInt(res.query.limit); i++) {
				data.rows.push({
					name: name[randomNum(0, 4)],
					num: randomNum(99, 123567),
					score: randomNum(0, 5) + "." + randomNum(1, 10),
					send: randomNum(0, 40),
					img: randomNum(0, 4),
					delivery_fee: randomNum(0, 5),
					distance: randomNum(0, 5) + "." + randomNum(1, 10),
					time: randomNum(20, 60),
					tag: tag[randomNum(0, 5)],
					activity: [
						{ text: "新用户立减8元", type: 0 },
						{ text: "新用户立减9元", type: 1 },
						{ text: "新用户立减10元", type: 1 },
						{ text: "新用户增加11元", type: 1 },
					],
				});
			}

			return {
				code: 200,
				data: data,
			};
		},
	},
];
